import { createStore } from 'vuex'
import createPersistedState from 'vuex-persistedstate' // 持久化
import loginModule from './modules/login'
import coursesModule from '@/store/modules/courses'
import delstudyMoudule from './modules/delstudy'
import userModule from './modules/user'

export default createStore({
  plugins: [createPersistedState()], // 默认将store中所有数据保存到localStorage中
  state: {},
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    login: loginModule,
    course: coursesModule,
    // delstudy 为命名空间名称
    delstudy: delstudyMoudule,
    userModule,
  },
})
